var t = require;
var i = module;
window.AD = {
    chanelName1: "touTiao2",
    delayTime: 0,
    wuDianRate: 0,
    gameOverTimes: 0,
    firstToMenu: !0,
    cc: !1,
    chanelName: "touTiao2",

    showAD: function(t, i) {
        i && console.log("激励视频广告:  " + i.name), (this.callN = i), (this.callerN = t);
        for (var n = arguments.length, e = new Array(2 < n ? n - 2 : 0), o = 2; o < n; o++) e[o - 2] = arguments[o];
        (this.dataN = e), this.chanelName != this.chanelName1 ? this.reward() : this.shiPin();
    },
    reward: function() {
        var t = this;
        setTimeout(function() {
            AD.callN && AD.callerN && AD.callerN.call(AD.callN, t.dataN);
        }, 100);
    },
    shiPin: function() {
        switch (this.chanelName) {
            case "android":
                AD_android.shiPin();
                break;
            case "touTiao2":
                AD_TouTiao.shiPin();
                break;
            case "vivo":
                AD_vivo.shiPin();
                break;
            case "oppo":
                AD_oppo.shiPin();
                break;
            case "huaWei":
                AD_HuaWei.shiPin();
                break;
            case "QQ":
                AD_QQ.shiPin();
                break;
            case "uc":
                AD_UC.shiPin();
                break;
            case "WX":
                AD_WX.shiPin();
                break;
            case "4399":
                AD_4399.shiPin();
                break;
            case "4399Box":
                AD_4399Box.shiPin();
                break;
            case "BD":
                AD_BD.shiPin();
        }
    },
    chaPing: function() {
        if ((0, this.chanelName == this.chanelName1))
            switch (this.chanelName) {
                case "android":
                    AD_android.chaPing();
                    break;
                case "touTiao2":
                    AD_TouTiao.chaPing();
                    break;
                case "vivo":
                    (0 < AD.wuDianRate || (!(arguments.length <= 0) && arguments[0])) && AD_vivo.chaPing();
                    break;
                case "oppo":
                    AD_oppo.chaPing();
                    break;
                case "huaWei":
                    AD_HuaWei.chaPing();
                    break;
                case "QQ":
                    AD_QQ.chaPing();
                    break;
                case "uc":
                    AD_UC.chaPing();
                    break;
                case "WX":
                    AD_WX.chaPing();
            }
    },
    showBanner: function() {
        if (this.chanelName == this.chanelName1)
            switch (this.chanelName) {
                case "android":
                    AD_android.showBanner();
                    break;
                case "touTiao2":
                    AD_TouTiao.showBanner();
                    break;
                case "vivo":
                    (0 < AD.wuDianRate || (!(arguments.length <= 0) && arguments[0])) && AD_vivo.showBanner();
                    break;
                case "oppo":
                    AD_oppo.showBanner();
                    break;
                case "huaWei":
                    AD_HuaWei.chaPing();
                    break;
                case "QQ":
                    AD_QQ.showBanner();
                    break;
                case "uc":
                    AD_UC.showBanner();
                    break;
                case "WX":
                    AD_WX.showBanner();
                    break;
                case "4399Box":
                    AD_4399Box.showBanner();
            }
    },
    hideBanner: function() {
        if (this.chanelName == this.chanelName1)
            console.log("hideBanner")
            switch (this.chanelName) {
                case "android":
                    AD_android.hideBanner();
                    break;
                case "touTiao2":
                    AD_TouTiao.hideBanner();
                    break;
                case "vivo":
                    AD_vivo.hideBanner();
                    break;
                case "huaWei":
                    AD_HuaWei.hideBanner();
                    break;
                case "QQ":
                    AD_QQ.hideBanner();
                    break;
                case "uc":
                    AD_UC.hideBanner();
                    break;
                case "WX":
                    AD_WX.hideBanner();
                    break;
                case "4399Box":
                    AD_4399Box.hideBanner();
                    break;
                case "oppo":
                    AD_oppo.hideBanner();
            }
    },
    moreGame: function() {
        switch (this.chanelName) {
            case "android":
                AD_android.moreGame();
                break;
            case "WX":
                AD_WX.shareAndCallback("");
        }
    },
    hezi: function() {
        AD_vivo.showBox();
    },
    gameOver: function() {
        if ((0, this.chanelName == this.chanelName1))
            switch ((this.gameOverTimes++, this.chanelName)) {
                case "android":
                    AD_android.chaPingVideo();
                    break;
                case "touTiao2":
                    AD_TouTiao.luPingOver();
                    break;
                case "vivo":
                case "oppo":
                    break;
                case "huaWei":
                    this.gameOverTimes % 2 == 0 && AD_HuaWei.addDesktop();
                    break;
                case "QQ":
                    0 < AD.wuDianRate && this.showAD(null, null);
                    break;
                case "4399Box":
                    this.gameOverTimes % 2 == 0 && AD_4399Box.chaPing();
                    break;
                case "BD":
                    0 < AD.wuDianRate && this.gameOverTimes % 2 == 0 && this.showAD(null, null);
            }
    },
    addToDesk: function() {
        if (this.chanelName == this.chanelName1)
            switch (this.chanelName) {
                case "vivo":
                    AD_vivo.addDesktop();
                    break;
                case "huaWei":
                    AD_HuaWei.addDesktop();
                    break;
                case "QQ":
                    AD_QQ.saveToDesktopQQ();
                    break;
                case "oppo":
                    AD_oppo.addDesktop();
                    break;
                case "touTiao2":
                    AD_TouTiao.addDesktop();
            }
    },
    couldZDJ: function() {
        return Tools.random(1, 100) < this.wuDianRate;
    },
    isBigScreen: function() {
        return (
            console.log("是长屏吗  " + cc.winSize.width / cc.winSize.height), 1.8 < cc.winSize.width / cc.winSize.height
        );
    },
    switchZDJ: function() {
        AD.delayTime = 1;
    },
};